home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
551-575
/
disk_573
/
plasma
/
fastpix.asm
next >
Wrap
Assembly Source File
|
1992-05-06
|
2KB
|
94 lines
CSECT text
;use SC BLINK option to merge this guy with our default c code hunk
XDEF @ReadPix
XDEF @FastPix
@FastPix
; D0 has x pos
; D1 has Y pos
; 4(sp) has color
Movem.l d2-d3/a2,-(sp)
lea _ytable(a4),a0 ; ytable array base addr
asl.l #1,d1 ; array offset for shorts
move.w 0(a0,d1.l),a2 ; byteoffset = ytable[y]
move.l d0,d2 ; get x in d2
asr.l #3,d2 ; div 8 for col byte
adda.l d2,a2 ; add to byteoffset
and.l #7,d0 ; x = x % 8
move.l #7,d2
sub.w d0,d2
ext.l d2
moveq.l #0,d3
move.w _nplanes(a4),d3
moveq.l #0,d0
pixloop move.w d3,d0
asl.l #2,d0
lea _bp(a4),a0
move.l a2,d1
move.l 0(a0,d0.l),a1
add.l d1,a1
checkcolor
move.l 16(sp),d0 ; load color
btst d3,d0
bne setpixel
clearpixel
bclr d2,(a1)
dbra d3,pixloop
movem.l (sp)+,d2-d3/a2
rts
setpixel
bset d2,(a1)
dbra d3,pixloop
movem.l (sp)+,d2-d3/a2
rts
@ReadPix
; D0 has x pos
; D1 has Y pos
Movem.l d2-d4/a2,-(sp)
lea _ytable(a4),a0 ; ytable array base addr
asl.l #1,d1 ; array offset for shorts
move.w 0(a0,d1.l),a2 ; byteoffset = ytable[y]
move.l d0,d2 ; get x in d2
asr.l #3,d2 ; div 8 for col byte
adda.l d2,a2 ; add to byteoffset
and.l #7,d0 ; x = x % 8
move.l #7,d2
sub.w d0,d2
ext.l d2
moveq.l #0,d3
move.w _nplanes(a4),d3
moveq.l #0,d0
moveq.l #0,d4
pixloo move.w d3,d4
asl.l #2,d4
lea _bp(a4),a0
move.l a2,d1
move.l 0(a0,d4.l),a1
add.l d1,a1
btst.b d2,(a1)
bne setpixel2
dbra d3,pixloo
movem.l (sp)+,d2-d4/a2
rts
setpixel2
bset.l d3,d0
dbra d3,pixloo
movem.l (sp)+,d2-d4/a2
rts
CSECT __MERGED,data ; naming this hunk __MERGED means a4 relative
XREF _bp
XREF _nplanes
XREF _ytable
end